'''###########################################################################################################################
### File: rayman-panda3d.py
### Name: Patrick Delaney, Andrew Oberlin
### Class: CSE 487
### Instructor: Dr.Zmuda
### Assignment: Final Project
### Description: Pending
################ 
'''

'''
TODO List:

Tuesday
#  Character Gen Done
#  Object Gen Done
#  Level  Gen Started

Wednesday
#  Continue Level Gen
#  Template Playing Level  (Level Class !!!)

Thursday
#  Continue Level Gen
#
Friday
#  Level Gen Done

Focus on Game Play until Due Date
'''
import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import *
from direct.showbase.DirectObject import *
from random import randint, choice, random
from direct.task.Task import Task
from sound_loader import SoundLoader
from camera_controller import CameraController
from main_gui import mainGUI
from game_maker_gui import GameMakerGUI
from character_gen import CharacterGen
from object_gen import ObjectGen
from level_gen import LevelGen
from create_main_character import MainCharacterGenerator
from title_screen import TitleScreen

class World(DirectObject):
	'''
	### Name: __init__ (Constructor)
	### Author: Andrew Oberlin, Patrick Delaney
	### Parameters: None
	### Description: Initializes all the game and game state variables and 
	###              window properties. Also starts my main gameloop task.
	'''
	def __init__(self):
		self.render = render
		self.taskMgr = taskMgr
		self.loader = loader
		self.camera = camera
		self.base = base
		self.base.disableMouse()
		
		self.loadSounds()
		self.setViewpoint()
		
		self.titlescreen = TitleScreen(self)
		
		self.accept("enter", self.startMainGUI)
		
		#Modules Start Here - 40% Submission
		#self.mainGui = mainGUI(self)
		#self.gameMakerGUI = GameMakerGUI(self)
		#self.characterGen = CharacterGen(self,"ProjectOne")
		#self.objectGen = ObjectGen(self, "ProjectOne")
		#self.levelGen = LevelGen(self,"ProjectOne")
		#self.mainCharacterGenerator = MainCharacterGenerator(self, "ProjectOne")
		
	'''
	### Name: loadSounds
	### Author: Andrew Oberlin, Patrick Delaney
	### Parameters: None
	### Description: Handles the sound
	'''
	def loadSounds(self):
		self.soundLoader = SoundLoader(self)
		
	'''
	### Name: setViewpoint
	### Author: Andrew Oberlin, Patrick Delaney
	### Parameters: None
	### Description:  Handles the camera
	'''
	def setViewpoint(self):
		self.cameraController = CameraController(self)
		
	'''
	### Name: setViewpoint
	### Author: Andrew Oberlin, Patrick Delaney
	### Parameters: None
	### Description:  Handles the camera
	'''
	def startMainGUI(self):
		self.titlescreen.hide()
		self.ignore("enter")
		self.mainGUI = mainGUI(self)
	
world = World()
run()